appModule.component('managementMeetings', {
  templateUrl: 'components/meeting-list/meeting-list.template.html',
  restrict: 'E',
  bindings: {
    metList: '<',
    inputForm: '<',
    inputFormdate: '<',
    selectForm: '<',
    buttonForm: '<',
    action: '<'
  },
  controller: [
    'PhoneService', '$timeout', '$scope', 'codeGenerate', 'api','$sessionStorage',
    function(PhoneService, $timeout, $scope, codeGenerate, api,$sessionStorage) {
      delete $sessionStorage.meetNO;
      var _this = this;
      $scope.fileurl = api.getAttachmentById;
      this.$onChanges = function() {
        if (this.metList !== undefined) {
          $scope.metList = this.metList.data.data;
          $('.man-list-auto').scrollTop(0);
        }
      };
      this.$onInit = function() {
        $scope.addSeesion = function(val) {
          $sessionStorage.meetNO = val;
        };
        this.seeLink = function(imgQr) {
          var imgSrc = codeGenerate(imgQr);
          layer.open({
            type: 1,
            area: ['420px', '240px'], //宽高
            content: '<div style="text-align: center;margin-top: 15px;"><img src="'+imgSrc+'" /> <span style="display: block;margin-top: 10px;">'+imgQr+'</span></div>'
          });
        };
        this.doAction = function($event, escape) {
          if (escape || $event.keyCode === 13) {
            this.action(this.formData);
          }
        };
        if (angular.isArray(this.buttonForm)) {
          var self = this;
          angular.forEach(this.buttonForm, function(btn) {
            btn.doAction = function() {
              (btn.action || self.action || angular.noop)(self.formData);
            };
          });
        }
      };


    }]
});
